<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2  (Unix)">
	<META NAME="CREATED" CONTENT="0;0">
	<META NAME="CHANGED" CONTENT="20110101;13184600">
	<STYLE TYPE="text/css">
	<!--
		@page { margin: 0.79in }
		P { margin-bottom: 0.08in }
		PRE { font-family: "Times New Roman" }
	-->
	</STYLE>
</HEAD>
<BODY LANG="el-GR" DIR="LTR">
<PRE LANG="en-US"><FONT SIZE=5><B>decsolbnd</B></FONT>


<FONT SIZE=4><SPAN LANG="en-US">Calculates the solution of a system of linear equations by Gaussian elimination with partial pivoting if the coefficient matrix is in band form and is stored rowwise in a one-dimensional array,</SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US">for details see book of Hang T. Lau, “A Java Numerical Library for Scientists and engineers|”, Chapman &amp; Hall, 2004</SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US"><B>Example: Can be run with F5 within the ScalaLab Editor (Ctrl-E to open the editor)</B></SPAN></FONT>


<SPAN LANG="en-US">import java.text.DecimalFormat;</SPAN>
<SPAN LANG="en-US">import numal.*;</SPAN>

<SPAN LANG="en-US">public class Test_decsolbnd extends Object {</SPAN>
<SPAN LANG="en-US">	</SPAN>
<SPAN LANG="en-US">	public static void main(String args[]) {</SPAN>

    <SPAN LANG="en-US">int i;</SPAN>
    <SPAN LANG="en-US">double band[] = new double[14];</SPAN>
    <SPAN LANG="en-US">double right[] = new double[6];</SPAN>
    <SPAN LANG="en-US">double aux[] = new double[6];</SPAN>
    
    <SPAN LANG="en-US">for (i=1; i&lt;=13; i++)</SPAN>
      <SPAN LANG="en-US">band[i] = (((i+1)/3)*3 &lt; i) ? 2.0 : -1.0;</SPAN>
    <SPAN LANG="en-US">right[1]=right[5]=1.0;</SPAN>
    <SPAN LANG="en-US">right[2]=right[3]=right[4]=0.0;</SPAN>
    <SPAN LANG="en-US">aux[2]=1.0e-12;</SPAN>
    <SPAN LANG="en-US">Linear_algebra.decsolbnd(band,5,1,1,aux,right);</SPAN>
    <SPAN LANG="en-US">DecimalFormat fiveDigit = new DecimalFormat(&quot;0.00000E0&quot;);</SPAN>
    <SPAN LANG="en-US">if (aux[3] == 5)</SPAN>
      <SPAN LANG="en-US">System.out.println(&quot;Delivers: &quot; +</SPAN>
        <SPAN LANG="en-US">fiveDigit.format(right[1]) + &quot;  &quot; +</SPAN>
        <SPAN LANG="en-US">fiveDigit.format(right[2]) + &quot;  &quot; +</SPAN>
        <SPAN LANG="en-US">fiveDigit.format(right[3]) + &quot;  &quot; +</SPAN>
        <SPAN LANG="en-US">fiveDigit.format(right[4]) + &quot;  &quot; +</SPAN>
        <SPAN LANG="en-US">fiveDigit.format(right[5]) + &quot;\nDeterminant is  &quot; +</SPAN>
        <SPAN LANG="en-US">fiveDigit.format(</SPAN>
          <SPAN LANG="en-US">Linear_algebra.determbnd(band,5,1,1,(int)aux[1])));</SPAN>
  <SPAN LANG="en-US">}</SPAN>
<SPAN LANG="en-US">}</SPAN></PRE>
</BODY>
</HTML>